import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
// import IndexView from '../views/index.vue'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/Index',
        name: 'Index',
        component: () => import('../views/index.vue'),
        children: [
            {
                path: '/Index/HomeView',
                name: 'HomeView',
                component: () => import('../views/Index/HomeView.vue'),
            },
            {
                path: '/Index/OverView',
                name: 'OverView',
                component: () => import('../views/Index/OverView.vue'),
            },
            {
                path: '/Index/HumanresourcesView',
                name: 'HumanresourcesView',
                component: () => import('../views/Index/HumanresourcesView.vue'),
            },
            {
                path: '/Index/NewsView',
                name: 'NewsView',
                component: () => import('../views/Index/NewsView.vue'),
            },
            {
                path: '/Index/PartybuildView',
                name: 'PartybuildView',
                component: () => import('../views/Index/PartybuildView.vue'),
            },
            {
                path: '/Index/BusinessView',
                name: 'BusinessView',
                component: () => import('../views/Index/BusinessView.vue'),
            },
            {
                path: '/Index/FdiView',
                name: 'FdiView',
                component: () => import('../views/Index/FdiView.vue'),
            },
            {
                path: '/Index/CorporateView',
                name: 'CorporateView',
                component: () => import('../views/Index/CorporateView.vue'),
            },
            {
                path: '/Index/ContactView',
                name: 'ContactView',
                component: () => import('../views/Index/ContactView.vue'),
            },
            {
                path: '/',
                redirect: '/Index/HomeView'
            }

        ]
    },
    // {
    //     path: '/other',
    //     component: () => import('../views/index.vue')
    // },
    //一级重定向
    {
        path: '/',
        redirect: '/Index'
    },
    //一级404页面
    // {
    //     path: '/:error(.*)',

    //     component: () => import('../views/NotFound.vue')
    // }
]

const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),
    routes, // `routes: routes` 的缩写
})

export default router